//
// Created by root on 6/18/17.
//

#include <stdlib.h>
#include "runner_base.h"
#include "../../src/engine/launcher.h"
#include "../../src/base/cmemory.h"

int setup_base(void **state) {
    return 0;
}

int teardown_base(void **state) {
    return 0;
}

void setup_env() {
    setenv(FUNNY_HOME, "/tmp", FALSE);
    LaunchArgs *args = (LaunchArgs *)sys_malloc(sizeof(LaunchArgs));
    args->component = NULL;
    args->repositories = "/usr/local/funny/lib";
    if (!funny_init(args)) {
        fprintf(stderr, "Initialize funny environment error!\n");
        exit(EXIT_FAILURE);
    }
}


FILE *create_temp_file(const char *string) {
    FILE *file = tmpfile();
    fputs(string, file);
    rewind(file);
    return file;
}

